package cn.sq.scaffold.ffmpeg.exception;

import cn.sq.scaffold.ffmpeg.config.ResponseBean;
import cn.sq.scaffold.ffmpeg.config.StatusCode;

/**
 * Created with IntelliJ IDEA.
 * User: SQ
 * Date: 2020/11/24
 * Time: 13:55
 * Description: 错误类型
 */

public class BaseExeception extends Exception{
    private Integer code;
    private ResponseBean responseBean;

    public BaseExeception(String message, Integer code) {
        super(message);
        this.code = code;
        this.responseBean= StatusCode.codeToResponseBean(code).setMsg(message);

    }
    public BaseExeception(Integer code) {
        super(StatusCode.codeToResponseBean(code).getMsg());
        this.code = code;
        this.responseBean=StatusCode.codeToResponseBean(code);
    }

    public BaseExeception() {
        super(StatusCode.codeToResponseBean(StatusCode.Error).getMsg());
        this.responseBean=StatusCode.codeToResponseBean(StatusCode.Error);

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public ResponseBean getResponseBean() {
        return responseBean;
    }

    public void setResponseBean(ResponseBean responseBean) {
        this.responseBean = responseBean;
    }
}
